#ifndef REALVALUECHECK_H_INCLUDED
#define REALVALUECHECK_H_INCLUDED
#include <cmath>
#include <limits>

class RealValueCheck {
    public:
        static inline bool isNan(double& d) {	return d!=d; };
        static inline bool isInf(double& d) {	return d == std::numeric_limits<double>::infinity(); };
        static inline bool check(double& d) {	return isNan(d) || isInf(d); };
        // all three return true if there is an error

        static inline double abs(double& d) {    if(d<0) return -d; return d;}
};

#endif // REALVALUECHECK_H_INCLUDED
